//
//  NodataView.m
//  carcareIOS
//
//  Created by ileo on 16/8/3.
//  Copyright © 2016年 chezheng. All rights reserved.
//

#import "NodataView.h"

@interface NodataView ()

@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UILabel *label;

@end

@implementation NodataView

-(void)setImage:(UIImage *)image attributedString:(NSAttributedString *)attributedString{
    self.imageView.size = image.size;
    self.imageView.image = image;
    self.imageView.center = CGPointMake(self.boundsCenter.x, self.boundsCenter.y - 70 * __MAIN_RATIO_H_667);
    self.label.top = self.imageView.bottom;
    self.label.centerX = self.imageView.centerX;
    self.label.attributedText = attributedString;
}

-(UIImageView *)imageView{
    if (!_imageView) {
        _imageView = [[UIImageView viewWithFrame:CGRectMake(0, 0, 1, 1)] setupOnView:self];
    }
    return _imageView;
}

-(UILabel *)label{
    if (!_label) {
        _label = [[[[UILabel viewWithFrame:CGRectMake(0, 0, 300, 60)] labelResetNumberOfLines:0] labelResetTextAlignment:NSTextAlignmentCenter] setupOnView:self];
    }
    return _label;
}

@end
